#include <stdio.h>
#include <stdlib.h>

#define ONE 0x1
#define TWO 0x2
#define THREE 0x4

void Test(int flags)
{
  //模拟实现三种选项传递
  if(flags & ONE)
    printf("This is one\n");

  if(flags & TWO)
    printf("This is two\n");

  if(flags & THREE)
    printf("This is three\n");
}

int main()
{
  Test(ONE | TWO | THREE);
  printf("-----------------------------------\n");
  Test(THREE);  //位图使得选项传递更加灵活
  return 0;
}

